<?php 
header("Content-Type: text/html;charset=utf-8");
	$texta = $_POST['texta'];
	$name = $_POST['username'];
	$phone = $_POST['phone'];
	$address = $_POST['address'];
	$email = $_POST['email'];
	$date = date('Y-m-d H:i:s');
	$db = new mysqli("localhost",'root','root','xlj');
	$r = $db->query("insert into ly values(null,null,null,'$email','$texta',null,'$date',null)");
	echo "<script>alert('留言成功！');location.href='index.php'</script>";
    if ($db->error) {
		echo "插入失败".$db->error;
	}else{
		echo "成功插入".$db->affected_rows."条数据";
	}


 ?>